package com.yst.feign1.controller


import cn.hutool.http.HttpUtil
import cn.hutool.json.JSONUtil

class TestControllerTest extends GroovyTestCase {

    def url = 'http://localhost:8001'

    void testFeign() {
        def path = '/test/testFeign?param=everybody'

        def response = HttpUtil.createGet(url + path)
                .execute()
                .body()

        println JSONUtil.formatJsonStr(response)
    }

    void testFeignError() {
        def path = '/test/testFeignError?param=demoData'

        def response = HttpUtil.createGet(url + path)
                .execute()
                .body()

        println JSONUtil.formatJsonStr(response)
    }
}
